package com.lk.test;

import java.util.Arrays;
import java.util.Scanner;

public class test1 {
    public static void main(String[] args) {

        System.out.println(method1(23432));
        System.out.println(method2());
        int[] a=method3();
        for (int i = 0; i <a.length; i++) {
            System.out.print(a[i]+" ");
        }
        System.out.println();
//        System.out.println(method4());
        System.out.println(method5(1000000));
    }
    public static boolean method1(int n){
        boolean boo=false;
        String str=n+"";
        String [] srr=str.split("");
        int n1=Integer.parseInt(srr[0]);
        int n2=Integer.parseInt(srr[1]);
        int n3=Integer.parseInt(srr[2]);
        int n4=Integer.parseInt(srr[3]);
        int n5=Integer.parseInt(srr[4]);
        if (n1==n5&&n1+1==n2){
            if (n2==n4&n2+1==n3){
                boo=true;
            }
        }
        return boo;
    }
    public static double method2(){
        double n=0;
        double a=2;
        double b=1;
        double c=0;
        for (int i = 0; i < 20; i++) {
            n+=a/b;
            c=b;
            b=a;
            a=a+c;
        }
        return n;
    }
    public static int[] method3(){
        int [] a=new int[]{1,2,3,4,5};
        a= Arrays.copyOf(a,a.length*2);
        return a;
    }
    public static String method4(){
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        String str2=str.replace(" ","");
        return str2;
    }
    public static double method5(double d){
        double bonus=0;
        double bonus1=100000*0.1;
        double bonus2=bonus1+100000*0.075;
        double bonus3=bonus2+200000*0.05;
        double bonus4=bonus3+200000*0.03;
        double bonus5=bonus4+400000*0.015;
        if (d<=100000){
            bonus+=d*0.1;
        }else if (d<=200000){
            bonus=(d-100000)*0.075;
            bonus+=bonus1;
        } else if (d<=400000) {
            bonus=(d-200000)*0.05;
            bonus+=bonus2;
        } else if (d<=600000) {
            bonus=(d-40000)*0.03;
            bonus+=bonus3;
        } else if (d<=1000000) {
            bonus=(d-600000)*0.015;
            bonus+=bonus4;
        } else if (d>1000000) {
            bonus=(d-1000000)*0.01;
            bonus+=bonus4;
        }
        return bonus;
    }
}
